export function MP() {
    return new Promise(function(resolve, reject) {
        window.onload = function() {
            resolve(BMap)
        }
        function removeScript(src) {
            var scripts = document.getElementsByTagName("script");
            for (var i = 0; i < scripts.length; i++) {
                if (scripts[i] && scripts[i].src && scripts[i].src.indexOf(src) != -1) {
                    scripts[i].parentNode.removeChild(scripts[i]);
                }
            }
        }
        removeScript("http://api.map.baidu.com/getscript?v=2.0&ak=OXAe1pjZBPpGzDWvENdfV7mb2nM3jz7M&services=&t=20200824135534");
        
        var script = document.createElement("script");
        script.type = "text/javascript";
        script.src = "http://api.map.baidu.com/api?v=2.0&ak=OXAe1pjZBPpGzDWvENdfV7mb2nM3jz7M&callback=onload";
        script.onerror = reject;
        document.head.appendChild(script);

    })
}
//   ————————————————
//   版权声明：本文为CSDN博主「SherrySherryBell」的原创文章，遵循 CC 4.0 BY-SA 版权协议，转载请附上原文出处链接及本声明。
//   原文链接：https://blog.csdn.net/sinat_35515778/article/details/72677390